import {
	defineConfig
} from 'vite'
import uni from '@dcloudio/vite-plugin-uni'

// const url = "http://localhost:9999";
// const url = "https://pro.joolun.com";
const url = "https://m.gaipharma.com";
// 文档: https://vitejs.dev/config/
export default defineConfig({
	plugins: [
		uni()
	],
	server: {
		// 是否开启 https
		https: false,
		// 端口号
		host: "0.0.0.0",
		// 端口号
		port: "8087",
		// 本地跨域代理 文档: https://cn.vitejs.dev/config/server-options.html#server-proxy
		proxy: {
			"^/auth": url,
			"^/upms": url,
			"^/code": url,
			"^/gen": url,
			"^/doc": url,
			"^/webjars": url,
			"^/swagger-resources": url,
			"^/weixin": url,
			"^/wxma": url,
			"^/mall": url,
			"^/pay": url,
			"^/v3": url,
			"/swagger-resources": url,
			"/live": {
				target: url,
				changeOrigin: true, //允许跨域设置
				ws: true //websocket代理设置: 本地开发的ws连接必须,否则连不上
			},
		},
	}
})